package com.news.news.service;


import com.news.news.dao.SystemDao;
import com.news.news.modle.System;
import com.news.news.util.JWTUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class SystemService {

    @Resource
    SystemDao systemDao;
//
    public System  systemList() {
        return  systemDao.SystemList();
    }

    public void save(System system,String token) {
        Integer adminid = JWTUtil.getTokenInfo(token).getClaim("id").asInt();
        system.setAdminid(adminid);
        systemDao.save(system);
    }

    public void updateLogo(String logo) {
        systemDao.updateLogo(logo);
    }
}
